package org.terramagnet.pdmviewer.parser;

public class PDMColumn extends PDMObject {

	private String id;
	private String name;
	private String code;
	/**
	 * 数据类型.
	 */
	private String dataType;
	/**
	 * 数据长度.
	 */
	private int length;
	/**
	 * 数据精度.
	 */
	private int precision;
	/**
	 * 字段是否为空，默认可空.
	 */
	private int mandatory = 0;
	/**
	 * 字段默认值.
	 */
	private String defaultValue;
	private String lowValue;
	private String highValue;
	/**
	 * 是否为主键.
	 */
	private boolean primary=false;
	private String comment;

	/**
	 * @return the id
	 */
	@Override
	public String getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(String id) {
		this.id = id;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the code
	 */
	public String getCode() {
		return code;
	}

	/**
	 * @param code the code to set
	 */
	public void setCode(String code) {
		this.code = code;
	}

	/**
	 * 数据类型.
	 *
	 * @return the dataType
	 */
	public String getDataType() {
		return dataType;
	}

	/**
	 * 数据类型.
	 *
	 * @param dataType the dataType to set
	 */
	public void setDataType(String dataType) {
		this.dataType = dataType;
	}

	/**
	 * 数据长度.
	 *
	 * @return the length
	 */
	public int getLength() {
		return length;
	}

	/**
	 * 数据长度.
	 *
	 * @param length the length to set
	 */
	public void setLength(int length) {
		this.length = length;
	}

	/**
	 * 数据精度.
	 *
	 * @return the precision
	 */
	public int getPrecision() {
		return precision;
	}

	/**
	 * 数据精度.
	 *
	 * @param precision the precision to set
	 */
	public void setPrecision(int precision) {
		this.precision = precision;
	}

	/**
	 * 字段是否为空，默认可空.
	 *
	 * @return the mandatory
	 */
	public int getMandatory() {
		return mandatory;
	}

	/**
	 * 字段是否为空，默认可空.
	 *
	 * @param mandatory the mandatory to set
	 */
	public void setMandatory(int mandatory) {
		this.mandatory = mandatory;
	}

	/**
	 * 字段默认值.
	 *
	 * @return the defaultValue
	 */
	public String getDefaultValue() {
		return defaultValue;
	}

	/**
	 * 字段默认值.
	 *
	 * @param defaultValue the defaultValue to set
	 */
	public void setDefaultValue(String defaultValue) {
		this.defaultValue = defaultValue;
	}

	/**
	 * @return the lowValue
	 */
	public String getLowValue() {
		return lowValue;
	}

	/**
	 * @param lowValue the lowValue to set
	 */
	public void setLowValue(String lowValue) {
		this.lowValue = lowValue;
	}

	/**
	 * @return the highValue
	 */
	public String getHighValue() {
		return highValue;
	}

	/**
	 * @param highValue the highValue to set
	 */
	public void setHighValue(String highValue) {
		this.highValue = highValue;
	}

	/**
	 * @return the comment
	 */
	public String getComment() {
		return comment;
	}

	/**
	 * @param comment the comment to set
	 */
	public void setComment(String comment) {
		this.comment = comment;
	}

	/**
	 * 是否为主键.
	 *
	 * @return the primary
	 */
	public boolean isPrimary() {
		return primary;
	}

	/**
	 * 是否为主键.
	 *
	 * @param primary the primary to set
	 */
	public void setPrimary(boolean primary) {
		this.primary = primary;
	}

	@Override
	public String toString() {
		return "PDMColumn{" + "id=" + getId() + ", name=" + getName() + ", code=" + getCode() + ", dataType=" + getDataType() + ", length=" + getLength() + ", precision=" + getPrecision() + ", mandatory=" + getMandatory() + ", defaultValue=" + getDefaultValue() + '}';
	}

}
